<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
	xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
	<div class="wrapper wrapper-content ">
		<div class="row">
			<div shiro:hasPermission="schedule:app:dept" class="col-sm-3">
				<div class="ibox ibox-body">
					<div class="ibox-title">
						<h5>选择部门</h5>
					</div>
					<div class="ibox-content">
						<div id="jstree"></div>
					</div>
				</div>
			</div>
			<div class="col-sm-12" id="tabList">
				<div class="ibox">
					<div class="ibox-body">
						<div class="fixed-table-toolbar">
							<div class="columns pull-left">
								<button shiro:hasPermission="schedule:app:add" type="button"
									class="btn  btn-primary" onclick="add()">
									<i class="fa fa-plus hidden" aria-hidden="true"></i>添加
								</button>
								<button shiro:hasPermission="schedule:app:batchRemove" type="button"
									class="btn  btn-danger" onclick="batchRemove()">
									<i class="fa fa-trash hidden" aria-hidden="true"></i>删除
								</button>
							</div>
							<div class="columns pull-right">
								<button class="btn btn-success" onclick="reLoad()">查询</button>
							</div>

							<div class="columns pull-right col-md-3 nopadding">
								<input id="searchName" type="text" class="form-control" style="width:180px;"
									placeholder="应用编号">
							</div>
						</div>
						<table id="exampleTable" data-mobile-responsive="true">
						</table>
					</div>
				</div>
			</div>
		</div>
		<!--shiro控制bootstraptable行内按钮看见性 来自dst的创新方案 -->
		<div>
			<script type="text/javascript">
				var s_edit_h = 'hidden';
				var s_remove_h = 'hidden';
				var s_worker_h = 'hidden';
			</script>
		</div>
		<div shiro:hasPermission="schedule:app:edit">
			<script type="text/javascript">
				s_edit_h = '';
			</script>
		</div>
		<div shiro:hasPermission="schedule:app:remove">
			<script type="text/javascript">
				var s_remove_h = '';
			</script>
		</div>
	</div>
	<div th:include="include :: footer"></div>
	<script type="text/javascript">
		var isLoadTree = false;
	</script>
	<div shiro:hasPermission="schedule:app:dept">
		<script type="text/javascript">
			isLoadTree = true;
			$(function (){
				$("#tabList").removeClass("col-sm-12");
				$("#tabList").addClass("col-sm-9");
				$('#jstree').on("changed.jstree", function(e, data) {
					if (data.selected == -1) {
						return ;
						var opt = {
							query : {
								deptId : '-1',
								appNo : $('#searchName').val(),
							}
						}
						$('#exampleTable').bootstrapTable('refresh', opt);
					} else {
						var opt = {
							query : {
								deptId : data.selected[0],
								appNo : $('#searchName').val(),
							}
						}
						$('#exampleTable').bootstrapTable('refresh',opt);
					}

				});
			});
		</script>
	</div>
	<script type="text/javascript" src="/js/appjs/schedule/app/main.js"></script>
</body>
</html>